package org.ethan.practice.launch_service

import android.app.Notification
import android.app.NotificationChannel
import android.app.NotificationManager
import android.app.Service
import android.content.Context
import android.content.Intent
import android.os.Binder
import android.os.Build
import android.os.IBinder
import android.util.Log

/**
 *
 * @ClassName:      TestService
 * @Desc:
 * @Author:         ethan
 * @CreateDate:     2019/10/14 14:52
 */
open class TestService2 : Service() {


    override fun onCreate() {
        super.onCreate()

        Log.e(TAG,"TestService2:onCreate() ")

       /* var manager: NotificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
            manager.createNotificationChannel(channel)
            var notification: Notification = Notification.Builder(applicationContext,
                CHANNEL_ID
            ).build()
            startForeground(1,notification)
        }*/

    }

    var binder: Binder? = null

    override fun onBind(intent: Intent?): IBinder? {
        return binder
    }


    companion object {
        const val CHANNEL_ID: String = "123"
        const val TAG = "TestService2"
    }
}